package com.yanqu.road.entity.activity.suitang.entity.rank;

import java.util.Comparator;

public class CrossSuiTangRankSort implements Comparator<CrossSuiTangRank> {
    @Override
    public int compare(CrossSuiTangRank o1, CrossSuiTangRank o2) {
        if (o2.getValue() != o1.getValue()) {
            return Long.compare(o2.getValue(), o1.getValue());
        }
        if (o2.getValue() == 0 && o1.getValue() == 0) {
            return Long.compare(o2.getTime(), o1.getTime());
        }
        if (o2.getAbility() != o1.getAbility()) {
            return Long.compare(o2.getAbility(), o1.getAbility());
        }
        return Long.compare(o1.getTime(), o2.getTime());
    }
}
